package com.test.information.maneger.demo;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.test.information.maneger.demo.dao.UserDao;
import com.test.information.maneger.demo.entity.User;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.core.AutoConfigureCache;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;

@SpringBootTest
class DemoTestMybatisPlus {

    @Autowired
    private UserDao userDao;

    @Test
    public void testInsert()
    {
       // User user1=new User();
        //user1.setAge(12);
        System.out.println(userDao.selectById(1));
        QueryWrapper<User> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("age",12);
        System.out.println(userDao.selectOne(queryWrapper));
//        if(userDao==null){
//            System.out.println("dao is null!");
//        }
      //  User user=new User();
//        for(int i=0;i<10;i++) {
//           // user.setId(i);
//            user.setAge(10 + i);
//            user.setName("zhangsan" + i);
////            user.setAge(10+i);
//            user.setPassword("123" + i);
//            userDao.insert(user);
//        }

    }
}
